package com.ete.service.net.api

import com.ete.service.entry.hardware.HardwareConfig
import com.ete.service.net.bean.BaseResponse
import com.ete.service.entry.hardware.StateEntry
import com.ete.service.entry.version.VersionUpgradeInfo
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

/**
 * Author:LiXian
 * <p>
 * Desc:平台服务接口
 * Version:1.0
 * date 2023/2/16 11:32
 */
interface ServiceApi {


    /**
     * 硬件信息上报（文档-运营平台.pdf-1.1硬件上报）
     */
    @POST("sys/device/data/batch/save")
    fun uploadHardwareInfo(
            @Body mConfig: HardwareConfig
    ): Call<BaseResponse<StateEntry>>


    /**
     * APP日志文件上传（文档-运营平台.pdf-1.2硬件日志文件上传）
     */
    @Multipart
    @POST("sys/device/log/save")
    fun uploadLogFile(
            @PartMap params: HashMap<String, RequestBody>
    ): @JvmSuppressWildcards Call<BaseResponse<Boolean>>


    /**
     * OTA在线升级（文档-体测云平台.pdf-11. 获取OTA升级）
     */
    @GET("pt/inner/operation/application/version")
    fun getLatestVersion(
            @Query("type") type: String,
            @Query("version") version: String
    ): Call<BaseResponse<VersionUpgradeInfo>>

    /**
     * 下载
     */
    @Streaming
    @GET
    fun download(@Url url: String): Call<ResponseBody>
}